import java.awt.Image;
import java.util.ArrayList;

public class MishagujiSama extends RoseScript
{
	private int firingRate;
	private double angle;
	public MishagujiSama(int d, int t)
	{
		super(d, t);
		firingRate = 210 - difficulty * 15;
		angle = 0;
		
	}

	public ArrayList<PointItem> run(Rose rose, Character player, int frame,	ArrayList<Enemy> enemies, ArrayList<PointItem> points, ArrayList<Image> packets, Image point)
	{
		incrementTime(frame);		
		
		if (frame % firingRate == 0)
		{
			rose.randomMove(50, 10, firingRate/2);
			for (int i = 0; i < 72; i++)
			{
				enemies.add(new PacketSA(packets.get(3), 3, (int)Math.round(rose.getX()), (int)Math.round(rose.getY()), 1.5, angle, 0,  .12));
				enemies.add(new PacketSA(packets.get(3), 3, (int)Math.round(rose.getX()), (int)Math.round(rose.getY()), 1.5, angle, 0, -.12));
				angle += 5;
			}

		}

		if (time < 0)
			points = endScript(point, rose, player, enemies);
		
		return points;
	}
}